import { JsonController, Authorized, Body, HeaderParam, Get, Post, UseBefore, QueryParam} from 'routing-controllers';
import { RequestLog } from '@/middleware/requestLog'
import { formlist } from '@/m_req/Comment'
import { Inject, Service } from 'typedi';
import { MenuServiceImpl } from '@/impl/MenuServiceImpl';
import { JsonResult, msgList, res } from '@/utils/jsonResult';
import config from '@/config'

@Service()
@JsonController(config.setPrefix("admin/menu"))
export class MenuController {

  @Inject()
  menuServiceImpl!: MenuServiceImpl;

  @Inject()
  json!: JsonResult<any>;


  @Get('/list')
  @UseBefore(RequestLog)
  async MenuList() {
    return this.menuServiceImpl.GetAllMenu();
  }


  
  @Post('/form')
  @UseBefore(RequestLog)
  async form(@Body() params: formlist) {

    return await this.menuServiceImpl.GetForm(params);
    
  }

}